﻿using DomainModel;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace Infrastructure.Mapper
{
    public class ArticleDetailConfiguration : EntityTypeConfiguration<ArticleDetailInfo>
    {
        public ArticleDetailConfiguration()
        {
            // Primary Key
            this.HasKey(t => t.ContentId);

            // Properties
            // Table & Column Mappings
            this.ToTable("CTB_ArticleDetailInfo");
            this.Property(t => t.ContentId).HasColumnName("ContentId");
            this.Property(t => t.Content).HasColumnName("Content");

            //this.HasRequired(t => t.Article)
            //    .WithRequiredDependent(t => t.ArticleDetail)
            //    .WillCascadeOnDelete(true);
              // .WithMany(t => t.ArticleDetail)
            //   .HasForeignKey(d => d.ContentId);
        }
    }
}
